#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>

namespace Ui
{
class MainWindow;
}

struct DeluacArgs;
class DeluacCore;
class QSettings;
enum class DeluacState;

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

protected:
    void dragEnterEvent(QDragEnterEvent *event);

    void dropEvent(QDropEvent *event);

private:
    void fetchDeluacArgs(DeluacArgs &args);

private slots:
    void on_btnBrowseDir_clicked();

    void on_btnGuessSignKey_clicked();

    void on_btnDecryptFile_clicked();

    void on_txtSearchPath_textChanged(const QString &text);

    void decryptCompleted(const QString &filePath, DeluacState state, int progressValue);

    void guessCompleted(const QString &xxteaSign, const QString &xxteaKey);

private:
    Ui::MainWindow *ui;

    DeluacCore *task;

    QString ini;
};

#endif // MAINWINDOW_H
